<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;

// Route::rule('路由表达式','路由地址','请求类型','路由参数(数组)','变量规则(数组)');
//课程主页(course)
Route::any('cindex', 'admin/course/index');
//添加课程
Route::get('cadd', 'admin/course/add');
Route::post('cs', 'admin/course/save', ['method' => 'post'], ['ext' => 'html|shtml']);
//编辑课程
Route::get('edit/[:id]', 'admin/course/edit');
//更新用户编辑之后的信息
Route::post('cupdate', 'admin/course/update');
//删除课程
Route::rule('delete11', 'admin/course/delete');
//班期主页(classdate)
Route::any('clindex', 'admin/classdate/index');
//添加班期
Route::get('cladd', 'admin/classdate/add');
Route::any('cls', 'admin/classdate/save', ['ext' => 'html|shtml']);
//编辑班期
Route::get('cledit/[:id]', 'admin/classdate/edit');
//搜索功能
Route::any('select', 'admin/classdate/select');
//更新班期编辑之后的信息
Route::post('clupdate/[:id]', 'admin/classdate/update');
//删除班期
Route::rule('cldelete', 'admin/classdate/delete');
//文章主页(article)
Route::any('artindex', 'admin/article/index');
//文章评论页
Route::any('artcomment/[:id]', 'admin/article/comment');
//文章评论页的删除
Route::any('comdelete/:id', 'admin/article/comdelete');
//文章评论状态的修改
Route::any('sta/:id', 'admin/article/dostatus');

//文章主页搜索与分页
Route::any('artsearch', 'admin/article/search');
//文章分类页
Route::any('sindex', 'admin/sort/index');
Route::any('sadd', 'admin/sort/add');
Route::any('sdelete', 'admin/sort/delete');
Route::post('sorts', 'admin/sort/save', ['method' => 'post'], ['ext' => 'html|shtml']);
Route::any('sedit/[:id]', 'admin/sort/edit');
Route::post('supdate', 'admin/sort/update');
Route::rule('sdelete', 'admin/sort/delete');
Route::any('artcomment', 'admin/article/comment');

//教师分类页
Route::any('ttindex', 'admin/teasort/index');
Route::any('ttadd', 'admin/teasort/add');
Route::any('ttdelete', 'admin/teasort/delete');
Route::post('ttsorts', 'admin/teasort/save', ['method' => 'post'], ['ext' => 'html|shtml']);
Route::any('ttedit/[:id]', 'admin/teasort/edit');
Route::post('ttupdate', 'admin/teasort/update');
Route::rule('ttdelete', 'admin/teasort/delete');

//API新闻接口
Route::any('nnindex', 'index/news/index');





//添加文章
Route::get('artadd', 'admin/article/add');
Route::post('arts', 'admin/article/save', ['method' => 'post'], ['ext' => 'html|shtml']);
//编辑文章
Route::get('artedit/[:id]', 'admin/article/edit');
//更新文章编辑之后的信息
Route::post('artupdate', 'admin/article/update');
//查看文章内容
Route::any('artdetails/[:id]', 'admin/article/details');
//删除文章
Route::rule('artdelete/:id', 'admin/article/delete');
//教师主页(teacher)
Route::any('techindex', 'admin/teacher/index');
//添加教师风采内容
Route::get('techadd', 'admin/teacher/add');
Route::post('techs', 'admin/teacher/save', ['method' => 'post'], ['ext' => 'html|shtml']);
//编辑教师风采内容
Route::get('techedit/[:id]', 'admin/teacher/edit');
//更新教师风采编辑之后的信息
Route::post('techupdate', 'admin/teacher/update');
//删除该教师的信息
Route::rule('techdelete/:id', 'admin/teacher/delete');


//进入前台的教师的列表页
Route::any('teaindex/[:id]', 'index/teacher/index');
//进入前台的教师详情页    
Route::any('teadetails/[:id]', 'index/teacher/details');
//进入前台教师分类页
Route::any('teachersss/[:id]','index/teacher/teasort');

//进入前台的内容列表页
Route::any('articleindex/[:id]', 'index/article/index');
//进入前台的内容详情页    
Route::any('articledetails/[:id]', 'index/article/details');
//前台添加更多
// Route::any('articlickadd/[:id]', 'index/article/clickadd');
//前台提交评论
Route::any('articlecomment/[:id]', 'index/article/comment');

//前台的文章分类页
Route::any('articles/[:id]','index/article/sort');
Route::any('zan','index/article/zan');
Route::any('artdel','index/article/delete');
//前台后台主页
Route::any('home', 'index/index/index');
Route::any('adm', 'admin/index/index');
Route::any('/', 'index/index/index');
//URL生成
Route::get('teacherdel', 'admin/Teacher/dodel');
Route::get('teacher', 'admin/Teacher/edit');
Route::post('teacher/select', 'admin/teacher/select');
Route::get('teacheredit', 'admin/Teacher/edit');
Route::post('teacherdoedit', 'admin/Teacher/doEdit');
Route::post('teacheradd', 'admin/Teacher/doAdd');
//Route::get('admin', 'admin/Main/index');
Route::get('admin/login', 'admin/Login/login');
Route::any('dolog', 'index/Login/dologin');
Route::any('reg', 'index/Register/register');
Route::any('doReg', 'index/Register/doRegister');
Route::post('checktel', 'index/Register/checktel');
Route::post('checkusername', 'index/Register/checkusername');
Route::get('/', 'index/Index/index');
Route::get('user/list', 'admin/User/index');
Route::get('user/edit', 'admin/User/edit');
Route::post('doEdit', 'admin/User/doEdit');
Route::get('user/add', 'admin/User/add');
Route::post('doAdd', 'admin/User/doAdd');
Route::get('join', 'admin/User/joinBlack');
Route::get('out', 'admin/User/outBlack');
Route::get('cate', 'admin/User/cate');
Route::get('admin/course','admin/user/course');
Route::get('actmoney','index/Baoming/getActivityMoney');
Route::get('baoming', 'index/Baoming/index');
Route::get('getclass', 'index/Baoming/getclassid');
Route::post('dobaoming', 'index/Baoming/dobaoming');
Route::get('exit','index/person/exit');
Route::get('checkinfo', 'index/Person/userinfo');
Route::get('person', 'index/Person/index');
Route::post('info', 'index/Person/info');
Route::get('cteacher', 'index/Teacher/index');
Route::post('dover', 'index/Person/dover');
Route::post('dopass', 'index/Person/pass');
Route::post('msg', 'index/Person/msg');
Route::get('error','admin/index/error');
Route::get('code','index/Invitation/index');
Route::post('money','index/Baoming/doMoney');
Route::get('ttt','index/Teacher/ttt');
Route::get('tt','index/Teacher/tt');
// wcl
// 【前台】
// 活动列表页
Route::get('act/list', 'index/Activity/index');
// 活动内容页
Route::get('act/content', 'index/Activity/content');
// 报名处理
Route::get('bm/dobaoming', 'index/Baoming/dobaoming');-
// 将报名提交后的信息存入数据库
Route::post('bm/dobaominginfo', 'index/Baoming/dobaominginfo');


// 【后台】
// 活动主页(activity)
Route::get('aindex', 'admin/Activity/index');
// 活动详情 查看
Route::get('acheck/:id', 'admin/Activity/check');
// 活动详情 返回活动列表
Route::post('returnlist', 'admin/Activity/index');
// 活动添加 页面加载
Route::get('aadd', 'admin/Activity/add');
// 活动添加 处理
Route::post('doadd', 'admin/Activity/doadd');
// 活动编辑 页面加载
Route::get('aedit/:id', 'admin/Activity/edit');
// 活动编辑 处理
Route::rule('adoedit', 'admin/Activity/doedit');
// 活动删除
Route::get('adelete', 'admin/Activity/delete');


// RBAC
// 后台登录 加载
Route::get('log', 'index/Login/login');
// 后台登录 跳转到首页 处理
Route::post('dologin', 'admin/Login/dologin');
// 退出登录
Route::get('layout', 'admin/Login/login');

// 用户管理
// 用户列表 加载
Route::get('uindex', 'admin/Userlist/index');
// 用户添加 页面加载
Route::get('uadd', 'admin/Userlist/add');
// 用户添加 处理
Route::post('udoadd', 'admin/Userlist/doadd');
// 用户编辑 页面加载
Route::get('uedit/:id', 'admin/Userlist/edit');
// 用户编辑 处理
Route::post('udoedit', 'admin/Userlist/doedit');
// 用户删除
Route::get('udelete', 'admin/Userlist/delete');
// 给用户分配角色 页面加载
Route::get('usaverole/:id', 'admin/Userlist/saverole');
// 将分配的角色存入数据库
Route::post('udosaverole', 'admin/Userlist/dosaverole');
// 用户修改密码 页面加载
Route::get('ueidtpwd/:id', 'admin/Userlist/editpwd');
// 用户修改密码 处理
Route::post('udoeidtpwd', 'admin/Userlist/doeditpwd');

// 角色列表 加载
Route::get('rindex', 'admin/Role/index');
// 角色添加 页面加载
Route::get('radd', 'admin/Role/add');
// 角色添加 处理
Route::post('rdoadd', 'admin/Role/doadd');
// 角色编辑 页面加载
Route::get('redit/:id', 'admin/Role/edit');
// 角色编辑 处理
Route::post('rdoedit', 'admin/Role/doedit');
// 角色删除
Route::get('rdelete', 'admin/Role/delete');
// 给角色分配权限 页面加载
Route::get('rsavenode/:id', 'admin/Role/savenode');
// 将分配的权限存入数据库
Route::post('rdosavenode', 'admin/Role/dosavenode');

// 权限列表 加载
Route::get('nindex', 'admin/Node/index');
// 权限添加 页面加载
Route::get('nadd', 'admin/Node/add');
// 权限添加 处理
Route::post('ndoadd', 'admin/Node/doadd');
// 权限编辑 页面加载
Route::get('nedit/:id', 'admin/Node/edit');
// 权限编辑 处理
Route::post('ndoedit', 'admin/Node/doedit');
// 权限删除
Route::get('ndelete', 'admin/Node/delete');


// 后台正则验证
// 用户管理
// 用户名 添加
Route::post('addcheckusername', 'admin/Userlist/addcheckusername');
// 用户名 编辑
Route::post('editcheckusername', 'admin/Userlist/editcheckusername');
// 角色名 添加
Route::post('addcheckname', 'admin/Role/addcheckname');
// 权限名 添加
Route::post('addchecknodename', 'admin/Node/addchecknodename');
// 活动名 添加
Route::post('addcheckactname', 'admin/Activity/addcheckactname');
// 密码验证
Route::post('edituserpass', 'admin/Userlist/edituserpass');


//Route::miss(function(){
//    return 123;
//});
Route::miss('admin/Error/index');

return [
    '__pattern__' => [
        'name' => '\w+',
    ],
    '[hello]' => [
        ':id' => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
        ':name' => ['index/hello', ['method' => 'post']],
    ],

];
